package myPackage;
import java.io.File;
import java.util.Scanner;
public class FileList {
  public static void main(String args[])  {
	  System.out.println("Input path");
	  
	  Scanner vvod=new Scanner(System.in);
	  String dirname;
	  dirname= vvod.nextLine();
	  printDir(dirname);	
	  
  }
  public static void printDir(String dirname){
      File f=new File(dirname);
      if(!f.exists()) {
        System.out.println(dirname+" not exist ");
      }
      else{
    	  System.out.println(dirname);
    	  String[] dirList=f.list();   
    	  for(int i=0;i<dirList.length;i++)
    	  {
              File f1=new File(dirname+File.separator+dirList[i]);
              if(!f1.isFile())
            	  System.out.println("-dir- "+dirList[i]);
    	  	
    	 // else  System.out.println(dirList[i]);
              }
    	  for(int i=0;i<dirList.length;i++)
    	  {
              File f1=new File(dirname+File.separator+dirList[i]);
              if(f1.isFile()) {
                    System.out.println(dirList[i]);
              }
      }
  
}}}

